package com.woniuxy.main.service.imp;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.woniuxy.main.mapper.GymMapper;
import com.woniuxy.main.mapper.StudentMapper;
import com.woniuxy.main.mapper.UserMapper;
import com.woniuxy.main.pojo.Gym;
import com.woniuxy.main.pojo.Student;
import com.woniuxy.main.pojo.User;
import com.woniuxy.main.service.UserGymService;
@Service
@Transactional
public class UserGymServiceImp implements UserGymService{

	@Resource
	private UserMapper userMapper;
	@Resource
	private GymMapper gymMapper;

	

	public UserMapper getUserMapper() {
		return userMapper;
	}



	public void setUserMapper(UserMapper userMapper) {
		this.userMapper = userMapper;
	}



	public GymMapper getGymMapper() {
		return gymMapper;
	}



	public void setGymMapper(GymMapper gymMapper) {
		this.gymMapper = gymMapper;
	}



	@Override
	public int updateGym(User user, Gym gym) {
		int row = 0;
		gymMapper.updateGym(gym);
		userMapper.addUserStuInfo(user);

		row = gymMapper.updateGym(gym) + userMapper.addUserStuInfo(user);
		return row;
	}



	

}
